<%@ page contentType="text/html;charset=UTF-8" language="java"  import="java.util.*" trimDirectiveWhitespaces="true" %>
<%@include file="/WEB-INF/pages/common/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>回收订单管理</title>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <%@include file="/WEB-INF/pages/common/commonCss.jsp"%>
  <link rel="stylesheet" href="${basePath}/resources/css/uniform.css" />
  <link rel="stylesheet" href="${basePath}/resources/css/select2.css" />
  <link rel="stylesheet" href="${basePath}/resources/css/matrix-style.css" />
  <link rel="stylesheet" href="${basePath}/resources/css/matrix-media.css" />
  <link rel="stylesheet" href="${basePath}/resources/css/admin/list.css" />
</head>

<body>

<style>
  .refurbishShow{
     display: inline-block;
  }
  .refurbishHide{
    display: none;
  }
  #inp.refurbishHide{
    display: none;
  }
</style>
<!--Header-part-->
<%@include file="/WEB-INF/pages/common/head.jsp"%>


<!--sidebar-menu-->
<%@include file="/WEB-INF/pages/common/left.jsp"%>

<div id="content">
  <div id="content-header">
    <div id="breadcrumb"> <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 首页</a> <a href="#" class="current">回收订单管理</a> </div>
    <%--<h1>商城订单管理</h1>--%>
  </div>
  <div class="container-fluid">
    <%--<input type="text" value="1980.00">--%>
    <hr>


    <div class="row-fluid">
      <div class="span12">


        <div class="widget-box">
          <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
            <h5>Data table</h5>
            <a style="float: right;margin-top: 0.2rem" onclick="tzAdmin.search()" class="btn btn-success"><i class="icon-search icon-white"></i></a>

            <label style="float: right;margin-top: 0.2rem">
              <input type="text" id="keywords" aria-controls="DataTables_Table_0" placeholder="输入查询关键字">
            </label>

          </div>
          <div class="widget-content nopadding">
            <table class="table table-bordered data-table">
              <thead>

              <tr>
                <th>订单号</th>
                <th>下单用户</th>
                <th>门店</th>
                <th>总价格</th>
                <th>实付价格</th>
                <th>下单数量</th>

                <th>创建时间<span class="up"></span> <span class="down"></span></th>
                <th>删除状态</th>
                <th>订单状态</th>
                <th>操作</th>

              </tr>
              </thead>
              <tbody id="tbody" data-model="order/recycle">
                  <tr>
                    <td id="loading" colspan="50"></td>
                  </tr>


              </tbody>
               <tfoot>

               </tfoot>
            </table>
            <div class="cpage"></div>

          </div>
        </div>
      </div>
    </div>
  </div>
</div>



<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
          &times;
        </button>
        <h4 class="modal-title" id="myModalLabel">订单状态修改</h4>
      </div>
      <div class="modal-body">
        在这里添加一些文本
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭
        </button>
        <button type="button" class="btn btn-primary">
          提交更改
        </button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal -->
</div>
   <!--Footer-part-->
<%@include file="/WEB-INF/pages/common/footer.jsp"%>

<!--end-Footer-part-->

<%@include file="/WEB-INF/pages/common/commonJS.jsp"%>
   <script type="text/javascript" src="${basePath}/resources/sg/tz_page.js"></script>
   <script src="${basePath}/resources/js/jquery.ui.custom.js"></script>
<script src="${basePath}/resources/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/js/jquery.uniform.js"></script>
<script src="${basePath}/resources/js/select2.min.js"></script>
<script src="${basePath}/resources/js/jquery.dataTables.min.js"></script>
<script src="${basePath}/resources/js/matrix.js"></script>
<%--<script src="${basePath}/resources/js/matrix.tables.js"></script>--%>

   <script>
       $(function(){
         tzAdmin.loadData(0,10,function(itemCount){
           tzAdmin.initPage(itemCount);//分页加载一次吗
         });
       });

       var flag = false;
       function  updateRefurbishPrice(id ,obj) {
           if(obj.innerHTML=="确定"){
               flag = true;
               var price = $("#inp").val();
           }
           console.log(flag);

            if(flag){
                $.ajax({
                    url:adminPath+"/order/updateRefurbishPrice",
                    type:'post',
                    data:{id:id , codeValue: price},
                    success:function (data) {
                        if(data == 1){
                            loading("修改翻新价格成功" , 4);
                            $("#price").html(price);
                            flag = !flag;
                        }
                    }
                });
            }
           obj.innerHTML =  obj.innerHTML=="确定" ? "修改" : "确定";
           $("#price").toggleClass("refurbishHide refurbishShow");
           $("#inp").toggleClass("refurbishHide refurbishShow");

       }



       function changeStatus(orderno , obj) {
           var statusCode = $(obj).val();
           console.log(orderno+"==" + statusCode);
           $.ajax({
               url:adminPath+"/order/updateOrder",
               type:"post",
               data:{orderno:orderno , shoporderstatuscode:statusCode},
               success:function (data) {
                   console.log(data);
                   if(data == 1){
                       loading("订单状态修改成功" , 4);
                   }
               }
           });
       }

   </script>

</body>
</html>
